// 所有关于课程的接口
import request from '../utils/request'
export const courseAddApi=(data)=>{
  return request("/VueHandler/CourseHandler?action=add","post",data)
}
// 课程信息请求 --添加完成回显,  编辑回显
export const getCourseInfo=(ID)=>{
  return request("/VueHandler/CourseHandler?action=getcourse","get",{ID:ID})
}
// 添加目录接口
export const addDirApi=(data)=>{
  return request("/VueHandler/CourseHandler?action=AddDirectory","post",data)
}
// 目录删除接口
export const delDirApi=(data)=>{
  return request("/VueHandler/CourseHandler?action=deleteDirectory","get",data)
}
// 编辑目录接口
export const editDirApi=(data)=>{
  return request("/VueHandler/CourseHandler?action=updateDirectory","post",data)
}
// 给目录下添加课件接口 添加视频
export const addDirVideo=(data)=>{
    return request("/VueHandler/CourseHandler?action=addvideo","get",data)
}
// 获取目录下的视频接口
export const getDirVideo=(data)=>{
  return request("/VueHandler/VideoHandler?action=showdir","get",data)
}

// 删除目录下的视频接口
export const delDirVideo=(data)=>{
  return request("/VueHandler/CourseHandler?action=delvideo","get",data)
}

// 课程整体保存接口
export const saveAllApi=(data)=>{
  return request("/VueHandler/CourseHandler?action=update","post",data)
}
// 获取课程列表接口
export const getCourseList=(data)=>{
  return request("/VueHandler/CourseHandler?action=show","post",data)
}
// 课程上架下架
export const upDownCourse=(ID)=>{
  return request("/VueHandler/CourseHandler?action=state","post",{
    ID:ID
  })
}
// 删除课程接口
export const delCourseApi=(_id)=>{
  return request("/VueHandler/CourseHandler?action=delete","post",{_id:_id})
}
// 课程置顶接口
export const toTopApi=(ID)=>{
  return request("/VueHandler/CourseHandler?action=top","post",{
    ID:ID
  })
}